﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PacManLib
{
    class Utility
    {
        /// <summary>
        /// Raises an event.
        /// </summary>
        public static void raiseEvent<T>(EventHandler<T> theEvent, object sender, T args) where T : EventArgs
        {
            if (theEvent != null)
            {
                theEvent(sender, args);
            }
        }

        /// <summary>
        /// Gets the long name of the AI.
        /// </summary>
        public static string getAILongName(IPacManAI ai)
        {
            return String.Format("{0} (Pac-Man, {1})", ai.getAIName(), ai.getCodersName());
        }

        /// <summary>
        /// Gets the long name of the AI.
        /// </summary>
        public static string getAILongName(IGhostAI ai)
        {
            return String.Format("{0} (Ghosts, {1})", ai.getAIName(), ai.getCodersName());
        }

    }
}
